#include <map>

using namespace std;

class Quote {
    /* ... */
};

class Disc_quote : public Quote {
    public:
        pair<size_t, double> discount_policy() const
            { return {quantity, discount}; }
    private:
        size_t quantity;
        double discount;
};

class Bulk_quote : public Disc_quote {
    /* ... */
};

int main()
{
    Bulk_quote bulk;
    Bulk_quote *bulkP = &bulk;          // 静态类型与动态类型一致
    Quote *itemP = &bulk;               // 静态类型与动态类型不一致
    bulkP->discount_policy();           // 正确：bulkP 的类型是 Bulk_quote*
    // itemP->discount_policy();        // 错误：itemP 的类型是 Quote*
}